package net.xju.controller;

import net.xju.common.framework.simplemvc.RequestMapping;
import net.xju.common.utils.JSONUtil;
import net.xju.common.utils.Result;
import net.xju.entity.GoodsType;
import net.xju.service.GoodsTypeService;
import net.xju.service.impl.GoodsTypeServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RequestMapping("/api/goodsType")
public class GoodsTypeController {

    GoodsTypeService goodsTypeService = new GoodsTypeServiceImpl();

    @RequestMapping("/list.do")
    public void list(HttpServletRequest req, HttpServletResponse resp){
        List<GoodsType> goodsTypeList = goodsTypeService.list();
        JSONUtil.printByJSON(resp, Result.success(goodsTypeList));
    }

}
